package cn.lingyangwl.agile.system.assembly;

import cn.lingyangwl.agile.model.TreeSelectResp;
import cn.lingyangwl.agile.system.model.entity.SysArea;
import cn.lingyangwl.agile.system.model.rqrs.area.AreaResp;
import cn.lingyangwl.agile.system.model.rqrs.area.AreaSaveReq;
import cn.lingyangwl.agile.system.model.rqrs.area.AreaTree;
import cn.lingyangwl.agile.system.model.rqrs.area.AreaUpdateReq;
import org.mapstruct.Mapper;
import org.mapstruct.Mapping;
import org.mapstruct.Mappings;

/**
 * 行政区划
 *
 * @author shenguangyang
 */
@Mapper(componentModel = "spring")
public interface SysAreaAssembly {
  AreaResp toAreaResp(SysArea source);
  
  SysArea toArea(AreaSaveReq source);
  SysArea toArea(AreaTree source);

  SysArea toArea(AreaUpdateReq source);
  SysArea toArea(SysArea source);

  AreaTree toAreaTree(SysArea source);

  @Mappings({
          @Mapping(source = "areaName", target = "name")
  })
  TreeSelectResp toAreaTreeSelect(SysArea source);
}
